package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.exams.ScoringRule;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.ScoringRulePO;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.ScoringRuleView;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ScoringRuleConverter {
    ScoringRuleConverter Instance = Mappers.getMapper(ScoringRuleConverter.class);

    ScoringRulePO toScoringRulePO(ScoringRule entity);

    ScoringRulePO toScoringRulePO(ScoringRule entity, @MappingTarget ScoringRulePO po);

    ScoringRule toScoringRule(ScoringRulePO po);

    ScoringRule toScoringRuleByView(ScoringRuleView view);
}
